package com.example.campus;

import android.content.Context;
import android.view.View;
import android.view.ViewStub;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebView;

public class WebInfo {
	WebView web;
	String url;
	Context context;
	public static final int RESP_TYPE = 0;
	public static final int URL_TYPE = 0;
	int type;

	public WebInfo(String url, Context context) {
		this.url = url;
		web = new WebView(context);

		web.getSettings().setJavaScriptEnabled(true);

		web.getSettings().setSupportZoom(true);

		web.getSettings().setBuiltInZoomControls(true);

		web.getSettings().setUseWideViewPort(true);

		web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
		web.getSettings().setLoadWithOverviewMode(true);
		web.getSettings().setUseWideViewPort(true);
		web.getSettings().setLoadWithOverviewMode(true);
		this.context = context;
	}

	public View getView() {
		if (type == URL_TYPE)
			web.loadUrl(url);
		return web;
	}
}
